package com.example.spring_ai.mcp.controller;

import com.example.spring_ai.mcp.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/client")
public class McpClientController {

    @Autowired
    ChatService chatClientService;
    @GetMapping("/time")
    public String getTime() {
        return chatClientService.callChat("调用getCurrentTime工具获取时间");
    }

    @GetMapping("/calc")
    public String calculate(@RequestParam String expr) {
        return chatClientService.callChat("计算表达式：" + expr);
    }
}
